//从url获取参数并转为对象
function getParameters(URL){
    let url = JSON.parse(`{"${decodeURI(URL.split("?")[1]).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"')}"}`)
    return url
}

console.log(getParameters("localhost:8080/#/api?name=John&age=25"))